/**
 * @projectName demo-master
 * @fileName CustomerClient.java
 * @packageName org.example.customer.feign
 * @author xaoyaoyao
 * @date 2021/3/30 10:20
 * @version V1.0
 * @copyright (c) 2021, xaoyaoyao@aliyun.com All Rights Reserved.
 */
package org.example.customer.feign;

import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
import java.util.List;
import org.example.customer.annotation.SelfFeignClient;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author xaoyaoyao
 * @className CustomerClient
 * @description
 * @date 2021/3/30 10:20
 */
@SelfFeignClient(url = "http://localhost:8850/nacos-provider/")
public interface CustomerClient {

	@Headers("Content-Type: application/json")
	@RequestLine(value = "GET /provider/testFeignApi?param={param}")
	HelloWorld testFeignProvider(@Param("param") String param);

	//	@Headers("Content-Type: application/json")
	@RequestLine("GET /provider/repos/{owner}/{repo}/contributors")
	List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);

	@RequestLine(value = "POST /provider/testFeignProviderHasParameter/{id}")
	HelloWorld testFeignProviderHasParameter(@Param("id") String id);

	@RequestLine("POST /provider/testFeignProviderHasParameterB")
	HelloWorld testFeignApiHasParameterBJson(@QueryMap HelloWorld helloWorld);

	@Headers("Content-Type: application/json")
	@RequestLine("POST /provider/testFeignApiHasParameterBJson")
	HelloWorld testFeignApiHasParameterBJson2(@RequestBody HelloWorld helloWorld);

}
